package com.sunnada.edu.system.dept.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;


@Repository
public class DeptDaoImpl extends BaseDaoImpl implements DeptDao {

	/*
	 * 获取部门树
	 */
	@Override
	public List deptTree(HashMap<String, String> params) {
		return selectList("dept_sqlmap.deptTree", params);
	}

	@Override
	public int deptAdd(HashMap<String, String> params) {
		return insert("dept_sqlmap.deptAdd",params);
	}

	/*
	 * 获取部门树
	 */
	@Override
	public List deptTree1(HashMap<String, String> params) {
		return selectList("dept_sqlmap.deptTree1", params);
	}
	@Override
	public List checkDeptDel(HashMap<String, String> params) {
		return selectList("dept_sqlmap.checkDeptDel", params);
	}
	
	@Override
	public int deptUpdate(HashMap<String, String> params) {
		return update("dept_sqlmap.deptUpdate",params);
	}
	@Override
	public int deptDel(HashMap<String, String> params) {
		return update("dept_sqlmap.deptDel",params);
	}
	@Override
	public Map getDeptByRecId(HashMap<String, String> params) {
		List list = selectList("dept_sqlmap.getDeptByRecId", params);
		if(list!=null&&list.size()>0){
			return (Map)list.get(0);
		}
		return null;
	}

	@Override
	public List<?> deptNameCheck(HashMap<String, String> params) {
		return selectList("dept_sqlmap.deptNameCheck", params);
	}

}
